package com.kelvin.oocl.filemanager.server;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import com.kelvin.oocl.filemanager.server.thread.UserThread;

public class FileServer {
	private static String baseDir = "./src/main/java/com/kelvin/oocl/filemanager/upload/";
	
	public void startUp(){
		ServerSocket server = null;
		BufferedOutputStream out = null;
		BufferedReader reader = null;
		try {
			server = new ServerSocket(8888);
			while(true){
				Socket socket = server.accept();
				new UserThread(socket,baseDir).start();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
